<template>
    <view>
        <div class="box">
            <view>提现金额</view>
            <view class="content-box">
                <view>¥</view>
                <u-input v-model="price" style="margin:0 8rpx 0 24rpx; flex: 1" placeholder="请输入金额"
                    trim />
                <view>全部提现</view>
            </view>
            <view class="box-text">余额：<text>¥9999</text></view>
        </div>
        <view class="footer-box"><u-button type="primary">立即提现</u-button></view>
    </view>
</template>
<script>
export default {
    data() {
        return {
            price: "",
            type: "number",
        };
    },
    watch: {
        price: {
            handler(n) {
                this.$nextTick(() => {
                    this.price = n
                        .replace(/[^\d\.]|^\./g, "")
                        .replace(/\.{2}/g, ".")
                        .replace(/^([1-9]\d*|0)(\.\d{1,2})(\.|\d{1})?$/, "$1$2")
                        .replace(/^0\d{1}/g, "0")
                })
            },
            immediate: true
        },
    },
    methods: {
    },
    // watch:{
    //     value:{
    //         handle(){
    //             this.value=this.value.repalce()
    //         }
    //     }
    // }
};
</script>

<style scoped lang="scss">
@import "index.scss";
</style>
